//
//  aboutVC.m
//  wanzhaoIM
//
//  Created by liuyuantao on 15/5/5.
//  Copyright (c) 2015年 liuyuantao. All rights reserved.
//

#import "AboutVC.h"
#import "MicroDef.h"


@interface AboutVC ()
{
    UIImageView *_errIconImageView;
    UILabel *_errMsgLabel;

}
@end

@implementation AboutVC

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        // Custom initialization
    }
    return self;
}

- (void)viewDidLoad
{
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    [self.navigationController setNavigationBarHidden:NO];
    [self.navigationItem setHidesBackButton:YES];
    [self.navigationItem setNewTitleCenter:@"关于"];
    
    UIView *superView = self.view;
    UIImageView *icon = [[UIImageView alloc] init];
    [icon setImage:[UIImage imageNamed:@"aboutdefaultHeaderImage"]];
    [superView addSubview:icon];
    
    UILabel *nameLabel = [[UILabel alloc] init];
    [nameLabel setText:@"e蜂通信"];
    [nameLabel setTextAlignment:NSTextAlignmentCenter];
    [nameLabel setTextColor:RGBCOLOR(0x64, 0x64, 0x64)];
    [nameLabel setFont:[UIFont systemFontOfSize:18.0f]];
    [superView addSubview:nameLabel];
    
    NSDictionary *infoDictionary = [[NSBundle mainBundle] infoDictionary];
    NSString* ver = [infoDictionary objectForKey:@"CFBundleShortVersionString"];
    UILabel *currentVersionLabel = [[UILabel alloc] init];
    [currentVersionLabel setText:[NSString stringWithFormat:@"当前版本号   V%@", ver]];
    [currentVersionLabel setTextAlignment:NSTextAlignmentCenter];
    [currentVersionLabel setTextColor:RGBCOLOR(0x92, 0x92, 0x92)];
    [currentVersionLabel setFont:[UIFont systemFontOfSize:15.0f]];
    [superView addSubview:currentVersionLabel];
    
    
    
    UILabel *companyLabel = [[UILabel alloc] init];
    [companyLabel setText:@"北京万朝科技有限公司 版权所有"];
    [companyLabel setTextAlignment:NSTextAlignmentCenter];
    [companyLabel setTextColor:RGBCOLOR(0x92, 0x92, 0x92)];
    [companyLabel setFont:[UIFont systemFontOfSize:14.0f]];
    [superView addSubview:companyLabel];
    
    CGFloat padding1 = 140-64;
    CGFloat padding2 = 30.0f;
    CGFloat padding3 = 50.0f;
    CGFloat padding4 = 55.0f;
    if(HARDWARE_SCREEN_HEIGHT >= 736)
    {
        padding1 = 500.0f/3-64;
        padding4 = 220.0f/3;
    }
    
    
    icon.frame = CGRectMake(0, padding1 - 8.0f, 115.0f, 115.0f);
    CGPoint iconCenter = icon.center;
    iconCenter.x = HARDWARE_SCREEN_WIDTH / 2.0f;
    icon.center = iconCenter;
    
    nameLabel.frame = CGRectMake(0, CGRectGetMaxY(icon.frame) + padding2 - 15.0f, 200.0f, 17.0f);
    iconCenter = nameLabel.center;
    iconCenter.x = HARDWARE_SCREEN_WIDTH / 2.0f;
    nameLabel.center = iconCenter;
    
    
    currentVersionLabel.frame = CGRectMake(0, CGRectGetMaxY(nameLabel.frame) + padding3, 200.0f, 13.0f);
    iconCenter = currentVersionLabel.center;
    iconCenter.x = HARDWARE_SCREEN_WIDTH / 2.0f;
    currentVersionLabel.center = iconCenter;
    
    companyLabel.frame = CGRectMake(0, HARDWARE_SCREEN_HEIGHT - 64 - 5.0f - 44.0f, 300.0f, 44.0f);
    iconCenter = companyLabel.center;
    iconCenter.x = HARDWARE_SCREEN_WIDTH / 2.0f;
    companyLabel.center = iconCenter;
    
   self.view.backgroundColor = RGBCOLOR(0xf3, 0xf3, 0xf3);
}

- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}


@end
